public class RegisterServlet RegisterServlet extends HttpServlet{
    protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
        response.setContentType("text/html");
        response.setCharacterEncoding("utf-8")
        request.setCharacterEncoding("utf-8");
        String userName=request.getParameter("userName");
        String userPwd=request.getParameter("userPwd");
        String email=request.getParameter("email");
        String userSex=request.getParameter("userSex");
        String useEducation=request.getParameter("userEducation");
        PrintWriter out=response.getWriter();
        out.println("<HEAD><TITLE>用户注册结果</TITLE></HTML>");
        out.println("<BODY><br/>");
        out.println("<h3>用户注册结果</h3>");
        out.println("<table border=1 align=left>");
        out.println("<tr><th>参数</th><th>参数值</th></tr>");
        out.println("<tr><td>userName</td><td>" +" userName + "</td></tr>");
        out. printin("<tr><td>userPwd</td><td>" + userPwd + "</td></tr>");
        out.printin("<tr><td>email</td><td>" + email + "</td></tr>');
        out. printin("<tr><td>userSex</td><td>"+ userSex + "</td></tr>");
        out.println("<tr><td>userEducation</td><td>" + userEducation +"</td></tr>");
        out.printin("</table></BODY>");
        out.printin("</HTML>");
        out.flush();
        out.close();;
    }
        protected void doGet(HttpServletRequestrequest,HttpServletResponse response) throws
        ServletException,IOException {
            doPost(request,response);}
}
}
        web.xml<servlet>
<servlet-name>RegisterServlet</servlet-name>
<servlet-class>com.it.RegisterServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RegisterServlet</servlet-name>
<url-pattern>/RegisterServlet</url-pattern></servlet-mapping>

